.class public Lcom/xingbook/ting/lyric/d;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/io/Serializable;


# instance fields
.field public a:Ljava/util/List;

.field public b:Z

.field private c:Z

.field private d:Lcom/xingbook/ting/lyric/f;

.field private e:I


# direct methods
.method public constructor <init>(Lcom/xingbook/ting/lyric/f;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/ting/lyric/d;->b:Z

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/ting/lyric/d;->c:Z

    iput-object p1, p0, Lcom/xingbook/ting/lyric/d;->d:Lcom/xingbook/ting/lyric/f;

    return-void
.end method


# virtual methods
.method a(J)I
    .locals 4

    const/4 v0, 0x0

    move v1, v0

    :goto_0
    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-lt v1, v0, :cond_1

    const/high16 v1, -0x8000

    :cond_0
    return v1

    :cond_1
    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/ting/lyric/j;

    iget v2, p0, Lcom/xingbook/ting/lyric/d;->e:I

    int-to-long v2, v2

    add-long/2addr v2, p1

    invoke-virtual {v0, v2, v3}, Lcom/xingbook/ting/lyric/j;->b(J)Z

    move-result v0

    if-nez v0, :cond_0

    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_0
.end method

.method public a()V
    .locals 1

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/ting/lyric/d;->c:Z

    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/xingbook/ting/lyric/d;->b:Z

    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->d:Lcom/xingbook/ting/lyric/f;

    invoke-interface {v0}, Lcom/xingbook/ting/lyric/f;->a()V

    return-void
.end method

.method public a(Ljava/util/ArrayList;)V
    .locals 13

    const-wide/16 v11, 0x0

    const/4 v3, 0x1

    const/4 v2, 0x0

    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    invoke-virtual {p1}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v4

    move v1, v2

    :goto_0
    invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_1

    if-eqz v1, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    new-instance v1, Lcom/xingbook/ting/lyric/e;

    invoke-direct {v1, p0}, Lcom/xingbook/ting/lyric/e;-><init>(Lcom/xingbook/ting/lyric/d;)V

    invoke-static {v0, v1}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V

    :cond_0
    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v5

    move v4, v2

    :goto_1
    if-lt v4, v5, :cond_5

    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    iget-object v1, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    add-int/lit8 v1, v1, -0x1

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/ting/lyric/j;

    invoke-virtual {v0}, Lcom/xingbook/ting/lyric/j;->a()J

    move-result-wide v4

    cmp-long v1, v4, v11

    if-lez v1, :cond_7

    const-wide/32 v1, 0x7fffffff

    invoke-virtual {v0, v1, v2}, Lcom/xingbook/ting/lyric/j;->a(J)V

    iput-boolean v3, p0, Lcom/xingbook/ting/lyric/d;->b:Z

    :goto_2
    invoke-virtual {p0, v3}, Lcom/xingbook/ting/lyric/d;->a(Z)V

    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->d:Lcom/xingbook/ting/lyric/f;

    invoke-interface {v0}, Lcom/xingbook/ting/lyric/f;->a()V

    return-void

    :cond_1
    invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcn/a/b/a/a;

    invoke-virtual {v0}, Lcn/a/b/a/a;->b()Ljava/util/ArrayList;

    move-result-object v5

    if-eqz v5, :cond_2

    invoke-virtual {v5}, Ljava/util/ArrayList;->size()I

    move-result v6

    if-nez v6, :cond_3

    :cond_2
    iget-object v5, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    new-instance v6, Lcom/xingbook/ting/lyric/j;

    invoke-virtual {v0}, Lcn/a/b/a/a;->a()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v6, v0, v11, v12}, Lcom/xingbook/ting/lyric/j;-><init>(Ljava/lang/String;J)V

    invoke-interface {v5, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_0

    :cond_3
    invoke-virtual {v5}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v5

    :goto_3
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-nez v1, :cond_4

    move v1, v3

    goto :goto_0

    :cond_4
    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/Integer;

    invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I

    move-result v1

    iget-object v6, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    new-instance v7, Lcom/xingbook/ting/lyric/j;

    invoke-virtual {v0}, Lcn/a/b/a/a;->a()Ljava/lang/String;

    move-result-object v8

    int-to-long v9, v1

    invoke-direct {v7, v8, v9, v10}, Lcom/xingbook/ting/lyric/j;-><init>(Ljava/lang/String;J)V

    invoke-interface {v6, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_3

    :cond_5
    const/4 v0, 0x0

    add-int/lit8 v1, v4, 0x1

    if-ge v1, v5, :cond_8

    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    add-int/lit8 v1, v4, 0x1

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/ting/lyric/j;

    move-object v1, v0

    :goto_4
    iget-object v0, p0, Lcom/xingbook/ting/lyric/d;->a:Ljava/util/List;

    invoke-interface {v0, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/ting/lyric/j;

    if-eqz v1, :cond_6

    invoke-virtual {v1}, Lcom/xingbook/ting/lyric/j;->a()J

    move-result-wide v6

    const-wide/16 v8, 0x1

    sub-long/2addr v6, v8

    invoke-virtual {v0, v6, v7}, Lcom/xingbook/ting/lyric/j;->a(J)V

    :cond_6
    add-int/lit8 v0, v4, 0x1

    move v4, v0

    goto/16 :goto_1

    :cond_7
    iput-boolean v2, p0, Lcom/xingbook/ting/lyric/d;->b:Z

    goto :goto_2

    :cond_8
    move-object v1, v0

    goto :goto_4
.end method

.method public declared-synchronized a(Z)V
    .locals 1

    monitor-enter p0

    :try_start_0
    iput-boolean p1, p0, Lcom/xingbook/ting/lyric/d;->c:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method
